package cn.com.vastbase.hibernate.sample.id.entity;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.ColumnDefault;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Getter
@Setter
@ToString
@NoArgsConstructor
@Entity
@Table(name = "sys_user_assign")
public class UserPkAssign implements Serializable {

    @Id
    private Integer id;
    private String name;
    private int age;
    private Date birthday;
    @Column(name = "create_time", insertable = false, updatable = false)
    @ColumnDefault("now()")
    private Date createTime;

    public UserPkAssign(String name, int age, Date birthday) {
        this.name = name;
        this.age = age;
        this.birthday = birthday;
    }
}
